<template>
  <div id="resourceManagement">
    <div id="tabelTitle">
      变更咨询师
    </div>
    <div id="table">
      <avue-crud
        v-model="form"
        :search.sync="searchForm"
        :page.sync="page"
        :data="tableData"
        :table-loading="tableLoading"
        :option="tableOption"
        @on-load="getList"
        @search-change="searchChange"
        @refresh-change="refreshChange"
        @size-change="sizeChange"
        @current-change="currentChange"
        @row-update="handleUpdate"
        @row-save="handleSave"
        @row-del="rowDel"
      >
        <template slot-scope="{disabled,size}" slot="stuNameSearch">
          <div class="inputStyle">
            <el-input placeholder="请输入姓名或手机号" :disabled="disabled" :size="size" style="width:50%; "
                      v-model="searchForm.keyWord"></el-input>
          </div>
        </template>
      </avue-crud>
    </div>

  </div>
</template>

<script>
import tableMixins from "@/mixins/tableMixin.vue"

export default {
  name: "changeConsultant",
  mixins: [tableMixins],
  data() {
    return {
      form: {},
      data: [],
      //访问接口前缀
      url: "yuanjiu.testnew/tn-change-record",
      searchForm: {},
      // 表格参数
      tableOption: {
        labelWidth:200,
        searchSpan:6,
        border: true,
        index: false,
        indexLabel: '序号',
        indexWidth: 50,
        stripe: true,
        align: 'center',
        searchMenuSpan:10,
        // searchLabelWidth: 100,
        calcHeight: 300,
        dialogWidth: 900,
        menuWidth: 200,
        menu: true,
        menuAlign: 'center',
        refreshBtn: false,
        columnBtn: false,
        searchShowBtn: false,
        addBtn: true,
        selection: true,
        rowKey: "id",
        emptyBtn: true,
        editBtn: false,
        viewBtn: true,
        delBtn: false,
        emptyBtnText: "重置",
        editBtnText: "修改",
        maxHeight: 645000,
        searchSize: "medium",
        column: [
          {
            prop: 'stuName',
            label: '姓名',
            search: true,
            searchLabelWidth:'50',
          },
          {
            prop: 'area',
            label: '联系方式',
          },
          {
            prop: 'productId',
            searchLabelWidth:'80',
            label: '培训类别',
            type: "select",
            dicUrl: '/yuanjiu.testnew/tn-product/listTnProduct',
            dicMethod: 'post',
            props: {
              label: "productName",
              value: "productId",
              res: "result"
            },
            search: true,
            rules: [{
              required: true,
              message: "请选择培训类别",
              trigger: "change"
            }]
          },
          {
            prop: 'progressSts',
            label: '进展情况',
            type: "select",
            dicUrl: '/yuanjiu.testnew/yj-config/getConfigByCode?itmCode=PRO_STS',
            props: {
              label: "itmName",
              value: "itmVal",
              res: "result"
            },
          },
          {
            prop: 'education',
            label: '原咨询师',
            type: "select",
            dicUrl: '/yuanjiu.testnew/yj-admin/getALLCounselor',
            props: {
              label: "adminRealName",
              value: "adminId",
              res: "result"
            },
            rules: [{
              required: true,
              message: "请选择培训类别",
              trigger: "change"
            }]
          },
          {
            prop: 'major',
            label: '接收咨询师',
            type: "select",
            dicUrl: '/yuanjiu.testnew/yj-admin/getALLCounselor',
            props: {
              label: "adminRealName",
              value: "adminId",
              res: "result"
            },
            rules: [{
              required: true,
              message: "请选择培训类别",
              trigger: "change"
            }]
          },
          {
            prop: 'chageReason',
            label: '变更原因',
          },
          {
            prop: 'changeTime',
            label: '变更时间',
            searchLabelWidth: '80',
            type: 'datetime',
            dateDefault: true,
            searchValue: ['', ''],
            searchSpan: 10,
            format: 'yyyy-MM-dd',
            valueFormat: 'yyyy-MM-dd',
            searchRange: true,
            search: true,
            searchClearable: false
          },

        ]
      },
      addUrl: "insertOrUpdate",
      listUrl: 'pageTnChangeRecord',
    }
  },
  methods: {
    uploadExcel() {
      // console.log('daoru')
    },
  },
  mounted() {
  }
}
</script>

<style scoped>
.inputStyle{
  width: 600px;
}
@media only screen and (max-width: 1600px){
  .inputStyle{
    width: 530px;
  }
}
@media only screen and (max-width: 1500px){
  .inputStyle{
    width: 430px;
  }
}
@media only screen and (max-width: 1366px){
  .inputStyle{
    width: 330px;
  }
}
@media only screen and (max-width: 900px){
  .inputStyle{
    width: 600px;
  }
}

</style>
